﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL.Entiteti;


namespace TestnaAplikacija
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                DAL.DAL d = DAL.DAL.Instanca;
                d.kreirajKonekciju("localhost", "dao", "root", "");

                DAL.DAL.StudentDAO sd = d.getDAO.getStudentDAO();
                Student novi = new Student("a", "b");
                novi.Id = sd.create(novi);

                List<Student> studenti = sd.getAll();
                foreach (Student s in studenti)
                    Console.WriteLine(s.Ime);

                d.terminirajKonekciju();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}
